##创建元组
tuple1 = (1,2,3)
tuple2 = ("apple","banana","cherry")
tuple3 = (1,"apple",3.14,[1,2,3])
tuple4 = (1,)
print(type(tuple1))
print(type(tuple2))
print(type(tuple3))
print(type(tuple4))

print("11===========")
print(tuple2[1])
print(tuple2[-1])


print("22===========")
print(tuple3[0:3])

print("1、元组解包")
a,b,c = tuple1
print(a,b,c)
print("2、元组解包 部分解包 使用 * 捕获多余的元素")
x,*y = tuple3
print(x)
print(*y)


print("元组常用方法")
tuple6=(1,1,2,2,3,3,45,34,33,344,2)
print(tuple6.count(2))
print(tuple6.index(2))

